import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/ext/ext.dart';
import 'package:enterprise_v6_app/app/modules/application/education/personal_profile/personal_profile_controller.dart';

class EducationProfileFaceController extends GetxController {
  final profile = Get.find<EducationProfileController>();

  /// 是否使用本地上传
  final useLocalUpload = false.obs;

  /// 显示 上传界面 or 照片显示界面
  final isUpload = false.obs;

  /// 人脸图片URL
  String? get url => urlList.firstOrNull;
  var urlList = <String>[];

  void onProfileChanged() {
    if (profile.entity?.url.isNotNullAndNotBlank ?? false) urlList = [profile.entity!.url];
    update();
  }

  void onSaveChanges() {
    if (url != null) profile.entity?.url = url!;
  }
}
